<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script>
	$(document).ready(function(){
		$( "#radio" ).buttonset();
		$("#radio1").click(function(){
			//jQuery location.href
			$(location).attr("href","getTeacherListOrderByName.do");
		});
		$("#radio2").click(function(){
			//jQuery location.href
			$(location).attr("href","getTeacherListOrderByDate.do");
		});
	});
</script>

<style>
#radio{
	font-size: x-small;
	font-family: '나눔고딕';
}
</style>  

<c:choose>
<c:when test="${sessionScope.admin==null}">
	<script type="text/javascript">
	$(document).ready(function(){
		alert("로그인 후 이용 가능합니다.");
		location.href="admin.do";
	});
	</script>	
</c:when>
<c:otherwise>
<h1>선생님관리</h1>
<center>
<form>
  <div id="radio">
    <input type="radio" id="radio1" name="radio" /><label for="radio1">이름순</label>
    <input type="radio" id="radio2" name="radio" /><label for="radio2">가입일순</label>
  </div>
</form>

<table bordercolor="lightgrey" style="border-width: 0.5mm;" bgcolor="#F8F8F8">
	<thead >
	<tr bgcolor="#E6E6E6">
		<td align="center" width="30"><font size="2">선택</font></td>
		<td align="center" width="100"><font size="2">아이디</font></td>
		<td align="center" width="30"><font size="2">성별</font></td>
		<td align="center" width="70"><font size="2">이름</font></td>
		<td align="center" width="100"><font size="2">전화번호</font></td>
		<td align="center" width="150"><font size="2">이메일</font></td>
		<td align="center" width="100"><font size="2">가입일</font></td>
	</tr>
	</thead>
	<tbody>
	
	<c:forEach items="${requestScope.tlvo.list }" var="list">
	<tr>
		<td align="center"><input type="checkbox" id="studentList"></td>
		<td align="center"><font size="2"><a href="">${list.id }<img src="${initParam.root }img/showinfo.png" width="12"></a></font></td>
		<td align="center"><font size="2">${list.gender }</font></td>
		<td align="center"><font size="2">${list.name }</font></td>
		<td align="center"><font size="2">${list.tel }</font></td>
		<td align="center"><font size="2">${list.email }</font></td>
		<td align="center"><font size="2">${list.enrolldate }</font></td>
	</tr>
	</c:forEach>
	</tbody>
</table>
<br>

<c:if test="${requestScope.tlvo.pagingBean.previousPageGroup }">
<a href="getTeacherListOrderByName.do?pageNo=${requestScope.tlvo.pagingBean.startPageOfPageGroup-1}">◀</a>
</c:if>

&nbsp;&nbsp;
<c:forEach var="i" 
begin="${requestScope.tlvo.pagingBean.startPageOfPageGroup}"
end="${requestScope.tlvo.pagingBean.endPageOfPageGroup}">
	<c:choose>
		<c:when test="${requestScope.tlvo.pagingBean.nowPage!=i}">
		<a href="getTeacherListOrderByName.do?pageNo=${i}">${i}</a>
		</c:when>
		<c:otherwise>
		${i}
		</c:otherwise>
	</c:choose>
</c:forEach>

&nbsp;&nbsp;
<c:if test="${requestScope.tlvo.pagingBean.nextPageGroup}">
<a href="getTeacherListOrderByName.do?pageNo=${requestScope.tlvo.pagingBean.endPageOfPageGroup+1}">▶</a>
</c:if>
</center>
</c:otherwise>
</c:choose>